
//
//  ServerForPublic.m
//  EJLX
//
//  Created by adc on 15/11/9.
//  Copyright © 2015年 江苏一键联信息科技有限公司. All rights reserved.
//

#import "ServerForPublic.h"

@interface ServerForPublic ()

@end

@implementation ServerForPublic
-(void)viewWillAppear:(BOOL)animated{
        self.navigationController.navigationBarHidden = YES;
}
- (void)viewDidLoad {
    [super viewDidLoad];

    UIView *nav = [[NavAndTbbarView alloc] initViewWithFrame:CGRectMake(0, 20, WIDE, 44) title:@"便民服务"  leftBtn:@selector(backBtn) leftImg:@"返回箭头"];
    nav.backgroundColor =RGB_COLOR(0x00c49f);
    [self.view addSubview:nav];
    _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 64, WIDE, HEIGHT-64)];
    _tableView.delegate = self;
    _tableView.dataSource = self;
    _tableView.tableFooterView = [[UIView alloc] init];
    //_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    [self.view addSubview:_tableView];
}
-(void)backBtn{
    [self.navigationController popViewControllerAnimated:YES];
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 2;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
    if (!cell) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@"cell"];
    }
  //  cell.imageView.image = [UIImage imageNamed:@""];
    if (indexPath.row == 0) {
        cell.textLabel.text = @"百度";
        cell.detailTextLabel.text = @"便民服务";
    }else if (indexPath.row == 1){
        cell.textLabel.text = @"同程旅游";
        cell.detailTextLabel.text = @"便民服务";
    }
    
    cell.accessoryType = UITableViewCellAccessoryNone;
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    return cell;
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    if (indexPath.row == 0) {
        
        GoToWebView *web = [[GoToWebView alloc] initWithurl:[NSURL URLWithString:@"http://www.baidu.com"] title:@"便民服务"];
        [self.navigationController pushViewController:web animated:YES];
    }else if (indexPath.row == 1){
        GoToWebView *web = [[GoToWebView alloc] initWithurl:[NSURL URLWithString:@"http://www.ly.com"] title:@"便民服务"];
        [self.navigationController pushViewController:web animated:YES];

    }
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
